Task/wp 1196 update django for ds#1716
Conversation
…unnecessary entries
| # djangocms-forms-maintained still uses the pre-Django 5 storage API. Keep its | ||
| # configuration sourced from STORAGES until the archived plugin is replaced. | ||
| DEFAULT_FILE_STORAGE = STORAGES["default"]["BACKEND"] | ||
| apply_storage_compatibility() |
There was a problem hiding this comment.
Can we update django-cms as well to not need this compatibility function?
There was a problem hiding this comment.
I hope so! Please tell me how this goes! I have long been worried about the form plugin, but 'django-cms>=3.0' suggests forms could still work.
Why Now Is the Right Time to Migrate from django CMS 3.11
— Django CMS Blog | Jan. 10, 2026
There was a problem hiding this comment.
I performed an exploratory upgrade through django CMS 4.1 to 5.0. However, django CMS 4 introduced significant changes to its data model, plugin tree, and publishing architecture. Because migrating our existing content and legacy plugins would require substantially more work and validation, we decided to keep django CMS at version 3.11.10 🤷♀️
| attrdict = { git = "https://github.com/DesignSafe-CI/AttrDict", rev = "83b779ee82d5b0e33be695d398162b8f2430ff33" } | ||
| django-recaptcha2 = { git = "https://github.com/DesignSafe-CI/django-recaptcha2", tag = "v1.4.1--compat-django4" } | ||
| djangocms-cascade = { git = "https://github.com/DesignSafe-CI/djangocms-cascade", rev = "9e9f9e3088a0fcfdc1b27ad7e08b68390aa6a570" } | ||
| djangocms-cascade = { git = "https://github.com/van-go/djangocms-cascade.git", rev = "009a7d8ccc5e8b1ff645091fe6780af71a798b31" } |

Overview
Update Django Version
The version being used by the lockfile is Django 4.2.27.
Django 4.2.x remains supported until April 2026.
Recommended target: Django 5.2.12 (latest 5.2 LTS patch).
PR Status
Related Links
Summary of Changes
pyproject.toml
Three dependency constraints changed:
poetry.lock
The lockfile was regenerated with Poetry 2.1.3. Principal resolved changes:
common_settings.py
Added the compatibility helper import:
from designsafe.settings.djangocms_forms_compat import apply_storage_compatibilityThen, after the Django 5 STORAGES configuration:
This lets the archived forms plugin obtain its legacy setting from the authoritative Django 5 storage configuration. It does not introduce a separate storage configuration.
djangocms_forms_compat.py
This is a new compatibility adapter for
djangocms-forms-maintained:It conditionally restores the removed
get_storage_classfunction:The conditional makes it safe if the code is ever run with an older Django version where
get_storage_classstill exists.This adapter is necessary because
djangocms-forms-maintainedstill:DEFAULT_FILE_STORAGEsettingdjango.core.files.storage.get_storage_classIt should be removed once that archived plugin is replaced with a Django 5-native forms package.
Testing Steps
UI
Notes